<html lang="en">
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../../static/struct/layuimini/lib/layui-v2.5.5/css/layui.css " media="all">
    <!--<script type="text/javascript" src="../../static/js/login/jquery.min.js"></script>-->
    <script src="../../../../static/struct/layuimini/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
    <script src="../../../../static/js/generaljs/watermarkbycanvas.js" charset="UTF-8"></script>
    <link rel="stylesheet" href="../../../../static/css/generalcss/layuitablecheckboxfix.css">
    <script src="../../../../static/struct/layuimini/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
</head>
<body onload="addWaterMarker()">
<!--
<p>Hello, <shiro:principal/>, how are you today?</p>
<p><shiro:user>guest</shiro:user></p>
<span th:text="${session.usercode}">人员工号</span>
-->
<br/>
<div class="layui-form">
<form class="layui-form" action="#" method="post" id="roleform">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">角色ID</label>
            <div class="layui-input-inline">
                <input type="text" name="roleid" readonly placeholder="系统自动生成" autocomplete="off" class="layui-input"  >
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">角色状态</label>
            <div class="layui-input-inline">
                <input type="text" name="available" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">角色描述</label>
            <div class="layui-input-inline">
                <input type="text" name="description" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">角色名称</label>
            <div class="layui-input-inline">
                <input type="text" name="rolename" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">备用1</label>
            <div class="layui-input-inline">
                <input type="text" name="vdef1"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">备用2</label>
            <div class="layui-input-inline">
                <input type="text" name="vdef2"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">备用3</label>
            <div class="layui-input-inline">
                <input type="text" name="vdef3"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">备用4</label>
            <div class="layui-input-inline">
                <input type="text" name="vdef4"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">备用5</label>
            <div class="layui-input-inline">
                <input type="text" name="vdef5"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button"  class="layui-btn" lay-submit="" lay-filter="demo1" onclick="addrole()">保存</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>

</form>
</div>
<script>

    function addrole() {
            layui.use(['layer', 'form'], function () {
                let form = layui.form;
                let layer = layui.layer;
                form.verify();
                let formjson = $("#roleform").serialize();
                //console.log(JSON.stringify(formjson));
                $.post("/action/addrole",formjson,function (resultjson) {
                    if (resultjson.code == '200'){
                        parent.layer.closeAll();
                        //location.reload();
                        parent.layer.msg("保存成功");
                    }else {
                        console.log(resultjson.msg);
                        layer.msg("保存失败" + resultjson.msg);
                    }
                });
            });

    }
</script>


</body>

</html>